{
 "cells": [
  {
   "cell_type": "code",
   "execution_count": 1,
   "metadata": {
    "collapsed": true
   },
   "outputs": [],
   "source": [
    "import pandas as pd\n",
    "import numpy as np"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 8,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "['EntryPointAddress',\n",
       " '.debug_table_index_link',\n",
       " 's_STT_SECTION_STB_LOCAL',\n",
       " 's_STT_SECTION_STB_GLOBAL',\n",
       " '.text_flags',\n",
       " 'R_386_16',\n",
       " '.text_table_index_link',\n",
       " '.gnu.hash_info',\n",
       " 'R_386_PC8',\n",
       " '.text_entsize',\n",
       " '.text_info',\n",
       " '.hash_entsize',\n",
       " '.bss_info',\n",
       " '.hash_info',\n",
       " '.comment_type',\n",
       " '.bss_table_index_link',\n",
       " '.bss_flags',\n",
       " '.gnu.hash_flags',\n",
       " '.bss_entsize',\n",
       " 'R_386_8',\n",
       " 'R_386_PLT32',\n",
       " 'VERSYM',\n",
       " '.got_info',\n",
       " 'STT_OBJECT_STB_LOCAL',\n",
       " '.got_table_index_link',\n",
       " 'R_386_GOTPC',\n",
       " 'R_386_32PLT',\n",
       " 'R_386_SIZE32',\n",
       " '.interp_flags',\n",
       " 'R_386_PC16',\n",
       " 'ELFVersion',\n",
       " 'R_386_32',\n",
       " 'R_386_GOTOFF',\n",
       " '.init_flags',\n",
       " 'R_386_NONE',\n",
       " '.init_entsize',\n",
       " '.init_table_index_link',\n",
       " '.init_info',\n",
       " '.comment_flags',\n",
       " '.hash_size',\n",
       " '.debug_info',\n",
       " '.data1_entsize',\n",
       " '.data1_table_index_link',\n",
       " '.dynstr_flags',\n",
       " '.dynstr_entsize',\n",
       " '.interp_entsize',\n",
       " '.dynstr_table_index_link',\n",
       " '.dynstr_info',\n",
       " '.data1_info',\n",
       " '.data1_alignment',\n",
       " '.comment_table_index_link',\n",
       " '.dynamic_flags',\n",
       " '.debug_alignment',\n",
       " '.debug_entsize',\n",
       " '.debug_size',\n",
       " '.dynamic_info',\n",
       " '.debug_flags',\n",
       " '.debug_type',\n",
       " '.dynstr_alignment',\n",
       " '.data1_size',\n",
       " '.data1_flags',\n",
       " '.fini_info',\n",
       " '.fini_entsize',\n",
       " '.fini_table_index_link',\n",
       " 'R_386_RELATIVE',\n",
       " '.data1_type',\n",
       " '.comment_info',\n",
       " '.hash_flags',\n",
       " 'R_386_PC32',\n",
       " '.fini_flags',\n",
       " '.comment_alignment',\n",
       " '.data_flags',\n",
       " '.dynsym_flags',\n",
       " 'R_386_GOT32',\n",
       " '.data_info',\n",
       " '.data_table_index_link',\n",
       " '.data_entsize',\n",
       " '.rel.plt_info',\n",
       " '.line_alignment',\n",
       " '.interp_table_index_link',\n",
       " '.conflict_info',\n",
       " '.conflict_alignment',\n",
       " '.conflict_table_index_link',\n",
       " '.conflict_flags',\n",
       " '.conflict_entsize',\n",
       " '.tdesc_type',\n",
       " '.tdesc_flags',\n",
       " '.tdesc_size',\n",
       " '.tdesc_entsize',\n",
       " '.tdesc_alignment',\n",
       " '.tdesc_info',\n",
       " '.tdesc_table_index_link',\n",
       " '.conflict_size',\n",
       " '.conflict_type',\n",
       " '.interp_info',\n",
       " '.lit8_table_index_link',\n",
       " '.lit8_info',\n",
       " '.lit8_entsize',\n",
       " '.gptab_alignment',\n",
       " '.lit8_size',\n",
       " '.lit8_alignment',\n",
       " '.gptab_type',\n",
       " '.gptab_flags',\n",
       " '.gptab_size',\n",
       " '.gptab_info',\n",
       " '.gptab_table_index_link',\n",
       " '.gptab_entsize',\n",
       " '.lit4_type',\n",
       " '.lit4_flags',\n",
       " '.lit4_size',\n",
       " '.liblist_alignment',\n",
       " '.rel.dyn_flags',\n",
       " '.liblist_info',\n",
       " '.lit4_entsize',\n",
       " '.liblist_table_index_link',\n",
       " '.rel.dyn_size',\n",
       " '.rel.dyn_entsize',\n",
       " '.rel.dyn_table_index_link',\n",
       " '.rel.dyn_info',\n",
       " '.rel.plt_entsize',\n",
       " '.rel.plt_size',\n",
       " '.rel.dyn_alignment',\n",
       " '.liblist_entsize',\n",
       " '.liblist_size',\n",
       " '.liblist_flags',\n",
       " '.reginfo_flags',\n",
       " '.lit4_alignment',\n",
       " '.lit4_info',\n",
       " '.lit4_table_index_link',\n",
       " '.reginfo_type',\n",
       " '.reginfo_size',\n",
       " '.liblist_type',\n",
       " '.reginfo_entsize',\n",
       " '.reginfo_alignment',\n",
       " '.reginfo_info',\n",
       " '.reginfo_table_index_link',\n",
       " '.lit8_flags',\n",
       " '.lit8_type',\n",
       " '.sbss_alignment',\n",
       " '.plt_table_index_link',\n",
       " '.plt_info',\n",
       " 'STT_FUNC_STB_LOCAL',\n",
       " '.shstrtab_type',\n",
       " '.note_alignment',\n",
       " '.rodata_table_index_link',\n",
       " '.rodata_info',\n",
       " 'rodata1_type',\n",
       " 'rodata1_flags',\n",
       " 'rodata1_info',\n",
       " 'rodata1_table_index_link',\n",
       " 'rodata1_entsize',\n",
       " '.note_info',\n",
       " '.note_table_index_link',\n",
       " '.note_entsize',\n",
       " '.line_entsize',\n",
       " '.line_flags',\n",
       " '.line_type',\n",
       " '.interp_alignment',\n",
       " '.line_size',\n",
       " '.line_table_index_link',\n",
       " '.note_size',\n",
       " '.line_info',\n",
       " '.note_flags',\n",
       " '.note_type',\n",
       " '.rel.plt_table_index_link',\n",
       " 'rodata1_alignment',\n",
       " '.shstrtab_flags',\n",
       " '.sbss_info',\n",
       " '.sdata_flags',\n",
       " '.sdata_size',\n",
       " '.sdata_type',\n",
       " '.shstrtab_entsize',\n",
       " '.rel.plt_alignment',\n",
       " '.sdata_entsize',\n",
       " '.sdata_table_index_link',\n",
       " '.sdata_info',\n",
       " '.sdata_alignment',\n",
       " '.sbss_table_index_link',\n",
       " '.sbss_entsize',\n",
       " '.sbss_size',\n",
       " '.got.plt_flags',\n",
       " '.got.plt_table_index_link',\n",
       " '.symtab_flags',\n",
       " '.strtab_flags',\n",
       " '.shstrtab_alignment',\n",
       " '.shstrtab_info',\n",
       " '.shstrtab_table_index_link',\n",
       " '.strtab_type',\n",
       " '.got.plt_info',\n",
       " '.symtab_type',\n",
       " '.strtab_entsize',\n",
       " '.strtab_alignment',\n",
       " '.strtab_info',\n",
       " '.strtab_table_index_link',\n",
       " 'rodata1_size']"
      ]
     },
     "execution_count": 8,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "attr_list = []\n",
    "with open('feature_selection/weka_features_toremove.txt', 'r') as f:\n",
    "    for l in f:\n",
    "        attr_list.append(l[27:].strip())\n",
    "attr_list"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 3,
   "metadata": {
    "collapsed": true
   },
   "outputs": [],
   "source": [
    "df_train = pd.read_csv('./results_final.csv')\n",
    "# df_test = pd.read_csv('./dataset/test.csv')"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 4,
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "(2, 342)\n"
     ]
    }
   ],
   "source": [
    "print df_train.shape"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 5,
   "metadata": {
    "collapsed": true
   },
   "outputs": [],
   "source": [
    "df_train.drop(attr_list, axis=1, inplace=True)\n",
    "# df_test.drop(attr_list, axis=1, inplace=True)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 6,
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "(2, 148)\n"
     ]
    }
   ],
   "source": [
    "print df_train.shape"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 7,
   "metadata": {
    "collapsed": true
   },
   "outputs": [],
   "source": [
    "df_train.to_csv('testing.csv', index=False)\n",
    "# df_test.to_csv('test_final.csv', index=False)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {
    "collapsed": true
   },
   "outputs": [],
   "source": []
  }
 ],
 "metadata": {
  "kernelspec": {
   "display_name": "Python 2",
   "language": "python",
   "name": "python2"
  },
  "language_info": {
   "codemirror_mode": {
    "name": "ipython",
    "version": 2
   },
   "file_extension": ".py",
   "mimetype": "text/x-python",
   "name": "python",
   "nbconvert_exporter": "python",
   "pygments_lexer": "ipython2",
   "version": "2.7.12"
  }
 },
 "nbformat": 4,
 "nbformat_minor": 2
}
